﻿@{
    Layout = null;
  
}
@model System.Collections.IEnumerable
<!DOCTYPE html>
<html>

<head>
    <title>文件上传管理</title>
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    @if (false)
    {
    
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>
      <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    @Html.DevExpress().GetStyleSheets(
                new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme },
                new StyleSheet { ExtensionType = ExtensionType.DropDownEdit, Theme = DevExpressHelper.Theme },
                new StyleSheet { ExtensionType = ExtensionType.ComboBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.TextBox, Theme = DevExpressHelper.Theme }
)
 

    <script src="@Url.Content("~/Scripts/checkinput.js")" type="text/javascript"></script>
    <style>
        #form_query
        {
        }
        .hide
        {
            display: none;
        }
        input, select
        {
            border: 1px solid #aecaf0;
        }
        input.txt, select.txt
        {
            width: 99%;
        }
        input.btn
        {
            padding: 3px 10px 2px;
            border: #a3c0e8 1px solid;
            background: #e2f0ff url(/EnterpriseFund/DXR.axd?r=0_54) repeat-x 50% top;
            color: #2c4d79;
            cursor: pointer;
        }
        input.btn:hover
        {
            background-image: url(/EnterpriseFund/DXR.axd?r=0_57);
        }
        th
        {
            text-align: right;
        }
    </style>
    <script type="text/javascript">
        if (top.boardtop) {
            top.boardtop.head_txt.innerText = "文件上传管理";
            //top.boardtop.showChooseYear(@ViewData["currentYear"], @ViewData["maxYear"], @ViewData["minYear"], rootPath + "/Admin/DocumentCls/Index?year=");
        }
     $(document).ready(function () {

         $("#hdept").val(DEPTS1.GetValue());

         $("#hDateBegin").val($('#yearSelect option:selected').val());
         $("#hDateEnd").val($('#monSelect option:selected').val());
         $("#hcode").val(CODE1.GetValue());

            var hdjsAlert = $("#hdjsAlert").val();


            if (hdjsAlert != "") {
                alert(hdjsAlert);
            }
           
        });
        var rootUrl = '@Url.Content("~/Admin/FTPManage/")';
        function OnBeginCallback(s, e) {
            e.customArgs["command"] = e.command;


         
            var FPayDateBegin = $("#hDateBegin").val();
            var FPayDateEnd = $("#hDateEnd").val();
            var dept=$("#hdept").val();

            var code = $("#hcode").val();
            e.customArgs["DateBegin"] = FPayDateBegin;
            e.customArgs["DateEnd"] = FPayDateEnd;
            e.customArgs["dept"] = dept;
            e.customArgs["code"] = code;
            //     alert(1);
        }

        //查询
        function search() {

            $("#hdept").val(DEPTS1.GetValue());

            $("#hDateBegin").val(yearSelect.GetValue());
            $("#hDateEnd").val(monSelect.GetValue());
            $("#hcode").val(CODE1.GetValue());

//            if (UPLOADBegin1.GetDate() != null) {
//                $("#hDateBegin").val(UPLOADBegin1.GetText());
//            }
//            else {
//                $("#hDateBegin").val("");
//            }
//            if (UPLOADEnd1.GetDate() != null) {
//                $("#hDateEnd").val(UPLOADEnd1.GetText());
//            }
//            else {
//                $("#hDateEnd").val("");
//            }

            gvEditing.Refresh();

        }


        //重置
        function undo() {
            $("#hDateBegin").val("");
            $("#hdept").val("");
            $("#hDateEnd").val("");
            $("#hcode").val("");
            //            $("#nsrsbh").val("");
            //            $("#nsrbm").val("");
            //            $("#nsrmc").val("");
            //            $("#fIssueNo").val("");
            //             NSRSBH1.val("");
            DEPTS1.SetValue("");
//            UPLOADBegin1.SetText("");
//            UPLOADEnd1.SetText("");

            form_query.reset();
        }

        function FidDel(codeNo) {

            if (confirm("确认删除文件?")) {
                $.ajax({
                    type: 'POST',
                    url: rootPath + '/FTPManage/delbyfid',
                    data: { fid: codeNo },
                    success: function (result) {
                        if (result == "ok") {
                            alert("删除成功");
                            gvEditing.Refresh();
                        }
                        else {
                            alert(result);
                        }
                    }
                });
            }
        }
        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnDownload":
                    {

                        var checkNo = "";
                        //  var PageNoList = "";
                        var checkNoList = ASPxClientGridView.Cast("gvEditing").GetSelectedKeysOnPage();
                        for (var i = 0; i < checkNoList.length; i++) {
                            checkNo += checkNoList[i] + ",";
                        }
                        if (checkNoList.length == 0) {
                            alert("请选择条目");
                            return;
                        }
                        $("#hFIDs").val(checkNo);
                        //if (CheckValues())
                        form_query.target = '_self';
                       
                        form_query.submit();
                        break;


                    }
               

            }
        }

        function keyPress() {
            if (event.keyCode && event.keyCode == 13) {
                search();

            }

        }
    </script>
</head>
<body  onkeypress="keyPress()">
    @Html.Partial("LoadPanelPartial")
    @Html.DevExpress().Menu(settings =>
{
    settings.Name = "toolBarMenu";
    settings.ItemAutoWidth = false;
    settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
    settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
    settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
    settings.Items.Add(item =>
    {
        item.Name = "btnDownload";
        item.Text = "批量下载";
        item.Image.Url = Url.Content("~/Content/ControlImages/download.png");
    });
    
	
    settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
    settings.ItemLinkMode = ItemLinkMode.ContentBounds;
}).GetHtml()
    @using (Html.BeginForm("DownLoadAll", "FTPManage", FormMethod.Post, new { id = "form_query" }))
    {
      
        <table class="query" width="800px" style="margin-left: auto; margin-right: auto">
            <tr>

                <td align="right" style="font-size: 14px">
                    部门：
                </td>
             
                <td>
             
                      
                           
                @Html.DevExpress().ComboBox(settings =>
               {
                   settings.Name = "DEPTS1";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                   settings.Properties.TextField = "Text";
                   settings.Properties.ValueField = "Value";
                   //settings.Properties.IncrementalFilteringMode = IncrementalFilteringMode.Contains;
                   //settings.Properties.DropDownStyle = DropDownStyle.DropDown;
                   //settings.Properties.ClientSideEvents.SelectedIndexChanged = "Changed";
                   settings.Properties.EnableClientSideAPI = true;
               }).BindList(ViewData["deptlist"]).Bind(ViewData["seldept"]).GetHtml()
            </td>
                  <td align="right" style="font-size: 14px">
                    年度：
                </td>
                <td>
                 @Html.DevExpress().ComboBox(settings =>
               {
                   settings.Name = "yearSelect";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                   settings.Properties.TextField = "Text";
                   settings.Properties.ValueField = "Value";
                   //settings.Properties.IncrementalFilteringMode = IncrementalFilteringMode.Contains;
                   //settings.Properties.DropDownStyle = DropDownStyle.DropDown;
                   //settings.Properties.ClientSideEvents.SelectedIndexChanged = "Changed";
                   settings.Properties.EnableClientSideAPI = true;
               }).BindList(ViewData["YearData"]).Bind(ViewData["selYear"]).GetHtml()
                 
                </td>
                 <td align="right" style="font-size: 14px">
                    月份：
                </td>
                 <td >
                  @Html.DevExpress().ComboBox(settings =>
               {
                   settings.Name = "monSelect";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                   settings.Properties.TextField = "Text";
                   settings.Properties.ValueField = "Value";
                   //settings.Properties.IncrementalFilteringMode = IncrementalFilteringMode.Contains;
                   //settings.Properties.DropDownStyle = DropDownStyle.DropDown;
               
                   //settings.Properties.ClientSideEvents.SelectedIndexChanged = "Changed";
                   settings.Properties.EnableClientSideAPI = true;
               }).BindList(ViewData["MonData"]).Bind(ViewData["selMon"]).GetHtml()
                 
    	
    </td>
    <td style="font-size: 14px">
    材料类型：
    </td>
                <td>
              
                 @Html.DevExpress().ComboBox(settings =>
               {
                   settings.Name = "CODE1";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                   settings.Properties.TextField = "FCodeName";
                   settings.Properties.ValueField = "FCodeNo";
                   settings.Properties.IncrementalFilteringMode = IncrementalFilteringMode.StartsWith;
                   settings.Properties.DropDownStyle = DropDownStyle.DropDown;
                   //settings.Properties.ClientSideEvents.SelectedIndexChanged = "Changed";
                   settings.Properties.EnableClientSideAPI = true;
               }).BindList(ViewData["SysBasicCodeName"]).GetHtml()
                
                
                </td> 
                 <td>
                    <table>
                        <tr>
                            <td>
                                @Html.DevExpress().Button(settings =>
                           {
                               settings.Name = "btnSearch";
                               settings.Text = "查询";
                               //settings.Height = System.Web.UI.WebControls.Unit.Pixel(20);
                               //settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                               settings.ControlStyle.CssClass = "button";
                               settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
                               settings.ClientSideEvents.Click = "search";
                           }).GetHtml()
                            </td>
                            
                            
                        </tr>
                    </table>
                </td>
            </tr>

        </table>
        @Html.Partial("FTPManageListPartial", Model)
        @Html.Hidden("hFIDs", "");
                                 @Html.Hidden("hdept", "");
      @Html.Hidden("hdjsAlert", (ViewData["jsAlert"]));
        @Html.Hidden("hDateBegin", "");
                 @Html.Hidden("hcode", "");   
                                          
                                          @Html.Hidden("hemp", ViewData["FEmplNo"])                      
                                      @Html.Hidden("hisall", ViewData["isall"]);
                                  @Html.Hidden("hDateEnd", "");
                           
    }
</body>
</html>
